<%@ Page Language="VB" MasterPageFile="~/site.master" AutoEventWireup="false" codefile="Fixtures.aspx.vb" Inherits="Fixtures" title="Fixtures" %>
<asp:Content ID="Content1" ContentPlaceHolderID="mainContent" Runat="server">

    <asp:label id="FixtureDateLabel" runat="server" style="visibility:hidden" />
    <asp:sqldatasource id="SqlDataSource1" runat="server"
        connectionstring="<%$ ConnectionStrings:WroxUnited %>">
        <SelectParameters>
            <asp:ControlParameter ControlID="FixtureDateLabel" PropertyName="Text" Name="FixtureDate" Type="DateTime"></asp:ControlParameter>
        </SelectParameters>
    </asp:sqldatasource>
    <asp:gridview
        id="fixturetable" runat="server" datakeynames="FixtureID" datasourceid="SqlDataSource1"
        emptydatatext="There are no data records to display." autogeneratecolumns="False" UseAccessibleHeader="true"
        allowpaging="True" allowsorting="True">
        <Columns>
            <asp:CommandField ShowSelectButton="True" SelectText="More Details"></asp:CommandField>
            <asp:BoundField AccessibleHeaderText="Fixture Number" ReadOnly="True" HeaderText="FixtureID" DataField="FixtureID" SortExpression="FixtureID" Visible="False"></asp:BoundField>
            <asp:BoundField AccessibleHeaderText="Fixture Date" HeaderText="Date" DataField="FixtureDate" SortExpression="FixtureDate" DataFormatString="{0:dd-MMM-yy}"></asp:BoundField>
            <asp:BoundField HeaderStyle-CssClass="foo" HeaderText="Fixture Type" DataField="FixtureType" SortExpression="FixtureType"></asp:BoundField>
            <asp:BoundField HeaderText="Opponents" DataField="Opponents" SortExpression="Opponents"></asp:BoundField>
            <asp:BoundField HeaderText="Goals For" DataField="GoalsFor" SortExpression="GoalsFor"></asp:BoundField>
            <asp:BoundField HeaderText="Goals Against" DataField="GoalsAgainst" SortExpression="GoalsAgainst"></asp:BoundField>
        </Columns>
    </asp:gridview>
    
    <p />
    <asp:sqldatasource id="SqlDataSource2" runat="server" providername="System.Data.SqlClient"
        selectcommand="SELECT [Notes] FROM [Fixtures] WHERE ([FixtureID] = @FixtureID)"
        connectionstring="<%$ ConnectionStrings:WroxUnited %>">
        <SelectParameters>
            <asp:ControlParameter Name="FixtureID" Type="Int32" ControlID="fixturetable" PropertyName="SelectedValue"></asp:ControlParameter>
        </SelectParameters>
     </asp:sqldatasource>
    <asp:detailsview id="DetailsView1" runat="server" datasourceid="SqlDataSource2" autogeneraterows="False">
        <Fields>
            <asp:BoundField DataField="Notes" SortExpression="Notes"></asp:BoundField>
        </Fields>
        
    </asp:detailsview>
    
</asp:Content>
